package o;

import com.huawei.appmarket.pkisign.apk.ApkFormatException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.List;
import o.dmb.a;

public abstract class dmc {
    public static List<dmd> ˋ(dmm o_dmm, a aVar) throws IOException, ApkFormatException {
        long ˊ = aVar.ˊ();
        if (ˊ > 2147483647L) {
            throw new ApkFormatException("ZIP Central Directory too large: " + ˊ);
        }
        long ॱ = aVar.ॱ();
        ByteBuffer ॱ2 = o_dmm.ॱ(ॱ, (int) ˊ);
        ॱ2.order(ByteOrder.LITTLE_ENDIAN);
        int ˋ = aVar.ˋ();
        List<dmd> arrayList = new ArrayList(ˋ);
        int i = 0;
        while (i < ˋ) {
            int position = ॱ2.position();
            try {
                dmd ˋ2 = dmd.ˋ(ॱ2);
                if (!ˋ2.ॱ().endsWith("/")) {
                    arrayList.add(ˋ2);
                }
                i++;
            } catch (Throwable e) {
                throw new ApkFormatException("Malformed ZIP Central Directory record #" + (i + 1) + " at file offset " + (ॱ + ((long) position)), e);
            }
        }
        return arrayList;
    }
}
